#include <stdio.h>
#include "rustSharedLib.h"

void handler(const char* input_message, char** output_message) {
    printf("Display in C handler function => %s\n", input_message);
    char msg[] = "This message comes from C handler function!";
    char c = msg[0];
    int pointer = 0;

    while(c != '\0'){
        output_message[0][pointer] = c;
        pointer++;
        c = msg[pointer];
    }

    output_message[0][pointer] = '\0';
    printf("A => %s\n", output_message[0]);
}

int main(int argc, char** argv) {
    SampleStruct arg;
    arg.handler = (void* (*)(const char*, char**))handler;

    try_it(arg);
    printf("c program terminated successfully!");
    return 0;
}